import { Column } from "typeorm";

export abstract class BaseEntity {
    @Column("bigint", { name: "created_by" })
    createdBy!: string;

    // 不使用 @CreateDateColumn, 通过订阅器统一管理
    @Column("timestamp without time zone", { name: "created_at", default: () => "CURRENT_TIMESTAMP" })
    createdAt!: Date;

    @Column("bigint", { name: "updated_by" })
    updatedBy!: string;

    // 不使用 @UpdateDateColumn, 通过订阅器统一管理
    @Column("timestamp without time zone", { name: "updated_at", default: () => "CURRENT_TIMESTAMP" })
    updatedAt!: Date;
}
